package com.cosmoplat.xikai.business.domain;

import com.cosmoplat.xikai.common.core.domain.BaseEntity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;

/**
 * 配送信息
 *
 * @TableName base_delivery_info
 */
@Data
@ApiModel(value = "配送信息", description = "用于表示系统中的配送信息")
public class BaseDeliveryInfo extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 主键
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "主键", example = "1")
    private Long id;

    /**
     * 备料号
     */
    @ApiModelProperty(value = "备料号", example = "PREP001")
    private String preparationNo;

    /**
     * 物料ID
     */
    @ApiModelProperty(value = "物料ID", example = "MAT001")
    @NotBlank(message = "配送信息 - 物料ID不能为空")
    private String materialId;

    /**
     * 物料编号
     */
    @ApiModelProperty(value = "物料编号", example = "CODE001")
    @NotBlank(message = "配送信息 - 物料编号不能为空")
    private String materialCode;

    /**
     * 物料名称
     */
    @ApiModelProperty(value = "物料名称", example = "示例物料")
    @NotBlank(message = "配送信息 - 物料名称不能为空")
    private String materialName;

    /**
     * 物料规格
     */
    @ApiModelProperty(value = "物料规格", example = "100x200mm")
    private String materialSpec;

    /**
     * 物料型号
     */
    @ApiModelProperty(value = "物料型号", example = "MODEL-A")
    private String materialModel;

    /**
     * 物料描述
     */
    @ApiModelProperty(value = "物料描述", example = "这是对物料的描述")
    private String materialDesc;

    /**
     * 工序ID
     */
    @ApiModelProperty(value = "工序ID", example = "PROCESS001")
    private String processId;

    /**
     * 工序编号
     */
    @ApiModelProperty(value = "工序编号", example = "PROC001")
    private String processCode;

    /**
     * 工序名称
     */
    @ApiModelProperty(value = "工序名称", example = "装配工序")
    private String processName;

    /**
     * 工作中心ID
     */
    @ApiModelProperty(value = "工作中心ID", example = "WORKCENTER001")
    private String workCenterId;

    /**
     * 工作中心编号
     */
    @ApiModelProperty(value = "工作中心编号", example = "WC001")
    private String workCenterCode;

    /**
     * 工作中心名称
     */
    @ApiModelProperty(value = "工作中心名称", example = "加工中心A")
    private String workCenterName;

    /**
     * 所需数量
     */
    @ApiModelProperty(value = "所需数量", example = "100.00")
    @NotBlank(message = "配送信息 - 所需数量不能为空")
    private BigDecimal requiredQty;

    /**
     * 计划时间
     */
    @ApiModelProperty(value = "计划时间", example = "2025-01-01 09:00:00")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date planTime;

    /**
     * 批次号
     */
    @ApiModelProperty(value = "批次号", example = "BATCH001")
    private String batchNo;

    /**
     * 序列号
     */
    @ApiModelProperty(value = "序列号", example = "SERIAL001")
    private String serialNo;

    /**
     * 配送位置ID
     */
    @ApiModelProperty(value = "配送位置ID", example = "DELIVERYPOS001")
    @NotBlank(message = "配送信息 - 配送位置ID不能为空")
    private String deliveryPosId;

    /**
     * 配送位置编号
     */
    @ApiModelProperty(value = "配送位置编号", example = "DP001")
    @NotBlank(message = "配送信息 - 配送位置编号不能为空")
    private String deliveryPosCode;

    /**
     * 配送位置名称
     */
    @ApiModelProperty(value = "配送位置名称", example = "仓库A")
    @NotBlank(message = "配送信息 - 配送位置名称不能为空")
    private String deliveryPosName;

    /**
     * 任务ID
     */
    @ApiModelProperty(value = "任务ID", example = "TASK001")
    private String taskId;


    /**
     * 是否缺料告警
     */
    @ApiModelProperty(value = "是否缺料告警，1：是,0：否", example = "0")
    private Integer shortage;

    /**
     * 产线库存数
     **/
    @ApiModelProperty(value = "产线库存数", example = "100.00")
    private BigDecimal stockQty;

    /**
     * 逻辑删除标志，默认未删除
     */
    @ApiModelProperty(value = "逻辑删除标志，默认未删除", example = "false")
    private Boolean isDelete;
}